<%@ taglib prefix="t" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<t:wrapper title="${title}">
	<jsp:body>
		<c:choose>
			<c:when test="${!done}">
				<form action="<c:url value="${curQuestion+1}" />" method="post">
					<label class="label100p">${question}</label>
					<input type="hidden" name="answeredQuestion" value="${curQuestion}" />
					<c:forEach items="${possibleAnswers}" var="answer" varStatus="status">
						<label class="label100p"><input type="radio" name="answer" class="radio" value="${answerChars[status.count-1]}" /> ${answerChars[status.count-1]} ${answer.answer}</label>
						
					</c:forEach>
					<button style="float:left;" type="button" onclick="location.href='${curQuestion-1}'"><spring:message code="progresstest.previous.button" /></button><button type="submit"><spring:message code="progresstest.next.button" /></button>
				</form>
			</c:when>
			<c:otherwise>
				<spring:message code="progresstest.do.end.text1" />${mark}<spring:message code="progresstest.do.end.text2" />
				<c:forEach items="${answers}" var="answer" varStatus="status">
					${status.count} ${answer}<br />
				</c:forEach>
				
				<button onclick="location.href='<c:url value="/" />'"><spring:message code="progresstest.do.end.button" /></button>
			</c:otherwise>
		</c:choose>
	</jsp:body>
</t:wrapper>